Skip to content

Fix root on Gradio mounted apps regression #10989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
mussonero opened this issue Apr 10, 2025 · 1 comment
Open
1 task done

Fix root on Gradio mounted apps regression #10989

mussonero opened this issue Apr 10, 2025 · 1 comment
Assignees
Labels
bug Something isn't working Priority High priority issues Regression Bugs did not exist in previous versions of Gradio

Comments

@mussonero
Copy link

Describe the bug

@aliabid94
I wanted to address the issue regarding the recent changes made to Fix root on gradio mounted apps setup, which had been running smoothly for over a year with FastAPI and HAProxy.

After reviewing the situation, I’ve decided to revert the recent comment/adjustment, as it seems to have impacted the previously stable configuration. The setup was operating without any issues, so I believe reverting back to the original configuration will restore the expected behavior.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr

def greet(name):
    return "Hello " + name + "!"


with gr.Blocks() as demo:
    name = gr.Textbox(label="Name")
    output = gr.Textbox(label="Output Box")
    greet_btn = gr.Button("Greet")
    greet_btn.click(fn=greet, inputs=name, outputs=output, api_name="greet")

from fastapi import FastAPI
app = FastAPI()

gr.mount_gradio_app(app, demo, path="/gradio")

# run app
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8060, root_path='/myapp')
INFO:     Loading environment from '.env'
INFO:     Started server process [29254]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8060 (Press CTRL+C to quit)
INFO:     172.22.96.1:56578 - "GET /myapp/myapp/gradio HTTP/1.1" 404 Not Found
INFO:     172.22.96.1:56582 - "GET /myapp/gradio HTTP/1.1" 307 Temporary Redirect
INFO:     172.22.96.1:56582 - "GET /myapp/myapp/gradio/ HTTP/1.1" 404 Not Found

ProxySettings

acl url_myapp path_beg /myapp

use_backend myapp if url_myapp

backend myapp
   balance roundrobin
   http-request set-header X-Forwarded-Port %[dst_port]
   http-request add-header X-Forwarded-Proto https if { ssl_fc }
   http-request replace-path /myapp[/]?(.*) /\1
   http-response replace-header ^Location (.*) /myapp/\1
   server node1-myapp 127.0.0.1:8060 check 

Screenshot

No response

Logs

System Info

Linux

Severity

I can work around it

@mussonero mussonero added the bug Something isn't working label Apr 10, 2025
@LukePeltier
Copy link

I'm having issues when specifying "/" as the location, it is redirecting the url to example.com//

is this related?

@abidlabs abidlabs added the Regression Bugs did not exist in previous versions of Gradio label Apr 11, 2025
@abidlabs abidlabs added the Priority High priority issues label May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority High priority issues Regression Bugs did not exist in previous versions of Gradio
Projects
None yet
Development

No branches or pull requests

4 participants